#角古猜想
n=eval(input())
k=0
if n%1==0 and n>=0:
    print(int(n),end=" ")
    while n!=1:
        if n%2==0:
            n/=2
        else:
            n=n*3+1
        k+=1;
        print(int(n),end=" ")
    print(f"\n{k}")
else:
    print("ERROR")

#
import math
def f(x):
    return ((x**3*math.cos(x/2)+1/2)*(math.sqrt(4-x**2)))
n=int(input())
a=-2
b=2
s=0
dx=(b-a)/n
for i in range(n):
    s+=(f(a+i*dx)+f(a+(i+1)*dx))*dx/2
print(f"wifi密码是:{s:.8f}")

#鸡兔同笼
a,b=map(int,input().split(" "))
k=0
m=0
if a>=0 and b>=0:
    for i in range(0,a+1):
        if(i*2+(a-i)*4==b):
            print(f'有{i}只鸡，{a-i}只兔')
            k=1
else :
    m=1;
if k==0 or m==1:
    print("Data Error!")

#物不知数
n=int(input())
k=0
for i in range(1,n+1):
    if i%3==2 and i%5==3 and i%7==2:
        k=1
        print(i)
if k==0:
    print("No solution!")

#二鼠打洞
n = int(input())
rat, mouse, day, time = 1, 1, 0, 1
distance_of_rat, distance_of_mouse = 0, 0
while n > 0:
    if n - mouse - rat < 0:
        time = n / (mouse + rat)
    n-=mouse+rat
    distance_of_mouse +=time * mouse
    distance_of_rat += time * rat
    rat *=  2
    mouse /=   2
    day +=1
print(day)
print(round(distance_of_mouse, 1), round(distance_of_rat, 1))

#宝塔上的琉璃灯
first = 3  # 第一层琉璃灯
while True:
    lantern = []  # 列表来保存所有层的琉璃灯
    m = first
    for i in range(8):  # 一共8层
        lantern.append(m)  # 将本层灯数目加入列表
        print(m)
        m = m * 2  # 下一层数目翻倍
    break

#李白买酒
wine =0.96875
print(wine)

#判断能否构成三角形
ls=[]
for i in range(3):
    a=eval(input())
    if a<=0:
        continue
    ls.append(a)
ls.sort()
if len(ls)==3:
    if ls[0]+ls[1]>ls[2]:
        print("True")
    else:
        print("False")
else:
    print("False")

#判定是否是直角三角形
ls=[]
for i in range(3):
    a=eval(input())
    if a<=0:
        continue
    ls.append(a)
ls.sort()
if len(ls)==3:
    if ls[0]**2+ls[1]**2==ls[2]**2:
        print("True")
    else:
        print("False")
else:
    print("False")

#判定是否是直角三角形
ls=[]
for i in range(3):
    a=eval(input())
    if a<=0:
        continue
    ls.append(a)
ls.sort()
if len(ls)==3:
    if ls[0]+ls[1]>ls[2]:
        if ls[0]==ls[1] or ls[1]==ls[2]:
            print("True")
        else:
            print("False")
    else:
        print("False")
else:
    print("False")

#计算三角形面积
import math
ls=[]
for i in range(3):
    a=eval(input())
    if a<=0:
        continue
    ls.append(a)
ls.sort()
if len(ls)==3:
    if ls[0]+ls[1]>ls[2]:
        c=sum(ls)/2
        s=math.sqrt(c*(c-ls[0])*(c-ls[1])*(c-ls[2]))
        print(f"{round(s,2)}")
    else:
        print("data error")
else:
    print("data error")

#计算三角形外接圆面积
ls=[]
for i in range(3):
    a=eval(input())
    if a<=0:
        continue
    ls.append(a)
ls.sort()
if len(ls)==3:
    if ls[0]+ls[1]>ls[2]:
        c=sum(ls)/2
        s=math.sqrt(c*(c-ls[0])*(c-ls[1])*(c-ls[2]))
        ci=ls[0]*ls[1]*ls[2]/(4*s)
        print(f"{round(ci,2)}")
    else:
        print("data error")
else:
    print("data error")

#计算三角形外接圆面积
ls=[]
for i in range(3):
    a=eval(input())
    if a<=0:
        continue
    ls.append(a)
ls.sort()
if len(ls)==3:
    if ls[0]+ls[1]>ls[2]:
        s=sum(ls)/2
        t=math.sqrt(s*(s-ls[0])*(s-ls[1])*(s-ls[2]))
        ci=(ls[0]*ls[1]*ls[2])/(4*t)
        print(f"{round(math.pi*ci**2,2)}")
    else:
        print("data error")
else:
    print("data error")

#地下水位预测
n=int(input())
print(f"预测距离为{n}米时十年间地下水位下降幅度为：",end="")
if(n==5):
    print("8.01 8.47 8.73 8.92 9.07 9.19 9.29 9.38 9.45 9.52")
elif n==50:
    print("5.0 5.45 5.72 5.91 6.05 6.17 6.27 6.36 6.44 6.51")
elif n==20:
    print("6.2 6.65 6.92 7.11 7.25 7.37 7.47 7.56 7.64 7.71")
elif n==1000:
    print("1.08 1.53 1.8 1.99 2.13 2.25 2.35 2.44 2.52 2.59")

#打印地下水位预测计算表
print(f'|{"预测距离":<5}|{1:<6}|{2:<6}|{3:<6}|{4:<6}|{5:<6}|{6:<6}|{7:<6}|{8:<6}|{9:<6}|{10:<6}|')
print("|0.5     |11.03 |11.48 |11.75 |11.94 |12.08 |12.2  |12.3  |12.39 |12.47 |12.54 |\n|1       |10.12 |10.58 |10.84 |11.03 |11.18 |11.29 |11.4  |11.48 |11.56 |11.63 |\n|5       |8.01  |8.47  |8.73  |8.92  |9.07  |9.19  |9.29  |9.38  |9.45  |9.52  |\n|10      |7.11  |7.56  |7.83  |8.01  |8.16  |8.28  |8.38  |8.47  |8.55  |8.61  |\n|20      |6.2   |6.65  |6.92  |7.11  |7.25  |7.37  |7.47  |7.56  |7.64  |7.71  |\n|30      |5.67  |6.12  |6.39  |6.58  |6.72  |6.84  |6.94  |7.03  |7.11  |7.18  |\n|50      |5.0   |5.45  |5.72  |5.91  |6.05  |6.17  |6.27  |6.36  |6.44  |6.51  |\n|100     |4.09  |4.55  |4.81  |5.0   |5.15  |5.27  |5.37  |5.45  |5.53  |5.6   |\n|200     |3.19  |3.64  |3.9   |4.09  |4.24  |4.36  |4.46  |4.55  |4.62  |4.69  |\n|500     |1.99  |2.44  |2.7   |2.89  |3.04  |3.16  |3.26  |3.35  |3.42  |3.49  |\n|1000    |1.08  |1.53  |1.8   |1.99  |2.13  |2.25  |2.35  |2.44  |2.52  |2.59  |\n|2200    |0.05  |0.5   |0.77  |0.95  |1.1   |1.22  |1.32  |1.41  |1.48  |1.55  |")

#回文素数
n=int(input())
i=1
count=0
while count<n:
    i+=1
    s=0
    if str(i) == str(i)[::-1]:
        for j in range(2,int(i**0.5)+1):
            if(i%j==0):
                s+=1
        if s==0:
            print(i,end=" ")
            count+=1

#反素数
n=int(input())
i=1
count=0
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x**0.5) + 1):
        if x % j == 0:
            return False
    return True

while count<n:
    i+=1
    if is_prime(i) and is_prime(int(str(i)[::-1])) and str(i)!=str(i)[::-1]:
        print(i,end=" ")
        count+=1

#股票收益计算
a=(15*1.1**15-15)*5500
print(f"{a:.2f}")

#股票收益计算函数
num = int(input())
purchase = float(input())
current = float(input())
a=(current-purchase)*num
print(f"{round(a,2)}")

#pow函数详解
def pow(x, n):  # 幂运算函数
    """接收一个数字x和一个整数n为参数,返回x的n次幂的结果的浮点数类型
    要求使pow(1.0, x) 和 pow(x, 0.0) 总是返回 1.0"""
    #########################Begin###############################
    return x**n
    #########################End###############################
if __name__ == '__main__':
    x = float(input())
    n = int(input())
    return_data = pow(x,n)
    print(return_data)

#最大公约数
def gcd(a, b):
    """接收两个正整数为参数，返回两个数的最大公约数"""
    #######################Begin############################
    for i in range(1,a+1):
        if a%i==0 and b%i==0:
            k=i
    return k
    #######################End############################
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    return_data = gcd(a,b)
    print(return_data)

#最小公倍数
def lcm(m, n):
    """接收两个正整数为参数，以整数类型返回两个数的最小公倍数"""
    ######################Begin###############################
    x=a*b
    r=a%b
    while r != 0:
        m = n
        n = r
        r = m % n
    return x//n
    ######################End###############################
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    return_data = lcm(a,b)
    print(return_data)

#fabs() 函数
def fabs(x):
    """返回x的绝对值"""
    ######################Begin###############################
    if x<0:
        return float(-x)
    else:
        return float(x)
    ######################End###############################
if __name__ == '__main__':
    x = eval(input())
    return_data = fabs(x)
    print(return_data)

#ceil() 函数
def ceil(x):
    """接受一个浮点数或整数，返回大于或等于该数的最小整数"""
    ######################Begin###############################
    if x%1==0:
        return x
    else:
        return int(x//1+1)
    ######################End###############################
if __name__ == '__main__':
    x = eval(input())
    return_data = ceil(x)
    print(return_data)

#floor()函数详解
def floor(x):
    """接受一个浮点数或整数，返回不大于该数的最大整数"""
    ######################Begin###############################
    return int(x // 1)
    ######################End###############################
if __name__ == '__main__':
    x = eval(input())
    return_data = floor(x)
    print(return_data)

#factorial函数详解
def factorial(n):
    """接收一个非负整数n为参数，返回n的阶乘，0的阶乘值为1"""
    ######################Begin###############################
    if n==0:
        return 1
    else:
        return factorial(n-1)*n
    ######################End###############################

if __name__ == '__main__':
    x = int(input())
    return_data = factorial(x)
    print(return_data)

#fsum函数
def fsum(iterable):
    """接收一个元素为数值的序列为参数，以浮点数类型返回各元素之和"""
    ######################Begin###############################
    s=0
    for i in iterable:
        s+=i
    return float(s)
    ######################End###############################
if __name__ == '__main__':
    x = list(map(eval, input().split()))
    return_data = fsum(x)
    print(return_data)

#素数判定
def is_prime(x):
    """判断素数的函数,接收一个正整数为参数，返回值是布尔类型。参数是素数时返回True，否则返回False"""
    # ==================Begin=================================
    # 补充你的代码
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True
    # ===================End================================
positive_int = int(input())  # 输入一个正整数
if is_prime(positive_int):
    print(f'{positive_int}是素数')
else:
    print(f'{positive_int}不是素数')

#输出N以内的所有素数
def is_prime(x):
    """判断素数的函数,接收一个正整数为参数，参数是素数时返回True，否则返回False。减小判定区间，减少循环次数，提升效率"""
    #======================Begin=================================
    # 补充你的代码
    #=======================End================================
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True

def output_prime(number):
    """接收一个正整数为参数，遍历从0到number之间的所有整数
    在一行中输出不大于number的所有素数，每个数字后一个空格，函数无返回值。"""
    #======================Begin=================================
    # 补充你的代码
    for i in range(number+1):
        if is_prime(i):
            print(i,end=" ")
    #=======================End================================
positive_int = int(input())
output_prime(positive_int)

#寻找回文素数
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True
def plalindrome_prime(number):
    for i in range(number):
        if is_prime(i):
            if str(i)==str(i)[::-1]:
                print(i,end=" ")

positive_int = int(input())
plalindrome_prime(positive_int)

#寻找反素数
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True

def reverse_prime(number):
    for i in range(number):
        if is_prime(i) and is_prime(int(str(i)[::-1])):
            if str(i)!=str(i)[::-1]:
                print(i,end=" ")

positive_int = int(input())
reverse_prime(positive_int)

#哥德巴赫猜想
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True
def goldbach_conjecture(num):
    if num < 4 or num % 2 == 1:
        print("Data error!")
    else:
        for i in range(num // 2 + 1):
            if is_prime(i) and is_prime(num - i):
                print(f"{num}={i}+{num - i}")
if __name__ == '__main__':
    positive_even = int(input())  # 输入一个正数
    goldbach_conjecture(positive_even)

#无参无返回值函数
def print_hi_human():
    print("人类，你好！")
if __name__ == '__main__':
    print_hi_human()

#无参有返回值函数
def say_hi_human():
    return "人类，你好！"
if __name__ == '__main__':
    print(say_hi_human())

#有参有返回值函数
def say_hi_person(full_name):
    return full_name+"，你好！"

if __name__ == '__main__':
    person_name = input()
    print(say_hi_person(person_name))

#多参函数
def say_hi_gender(full_name, gender):  # name 和gender为形式参数
    if gender=="男":
        gender="先生"
    else:
        gender="女士"
    return "尊敬的"+full_name+gender+"，欢迎来到火星！"

if __name__ == '__main__':
    print(say_hi_gender(input(),input()))

#任意数量参数
def say_hi_multi_parameter(*ls):  # 括号里填上参数
    # 对齐此处补充代码
    for i in ls:
        print(f"{i}，你好！")
# 调用say_hi_multi_parameter并传入参数
say_hi_multi_parameter('孟浩然')
say_hi_multi_parameter('杜甫', '李白', '柳宗元', '李商隐')

#pow函数详解
def pow(x, n):  # 幂运算函数
    return x**n
if __name__ == '__main__':
    x = float(input())
    n = int(input())
    return_data = pow(x,n)
    print(return_data)

#fabs() 函数
def fabs(x):
    if x<0:
        return float(-x)
    else:
        return float(x)
if __name__ == '__main__':
    x = eval(input())
    return_data = fabs(x)
    print(return_data)

#汽车迷
def Car(year,sty,*brand): # 括号里补充你的代码
#####
    if brand:  # 如果输入brand 执行以下语句
        brand = brand[0]
    else:
        brand = '宝马'
    return f'这是一辆{year}年生产，型号是{sty}的{brand}牌汽车。'
# 以下内容不要修改
ls = input().split()  # 根据空格切分输入字符串为列表
print(Car(*ls))       # 调用函数，取列表中的全部数据做参数

#编写函数输出自除数
def f(x):
    if '0' in str(x):
        return False
    for i in str(x):
        if x % int(i) != 0:
            return False
    else:
        return True
n = int(input())
for x in range(1, n + 1):
    if f(x):
        print(x, end=' ')

#二分法求平方根B
import math
def f(num, accuracy):
    low, high = 0, num + 0.25
    while True:
        x = (high + low) / 2
        if abs(x * x - num) <= accuracy:
            return x
        elif x * x - num < 0:
            low = x
        else:
            high = x

n, error = map(float, input().split(','))
print('{:.8f}'.format(f(n, error)))
print('{:.8f}'.format(math.sqrt(n)))

#素数判定函数
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True

#寻找回文素数
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True
def plalindrome_prime(number):
    for i in range(number):
        if is_prime(i):
            if str(i)==str(i)[::-1]:
                print(i,end=" ")

positive_int = int(input())
plalindrome_prime(positive_int)

#寻找反素数
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True

def reverse_prime(number):
    for i in range(number):
        if is_prime(i) and is_prime(int(str(i)[::-1])):
            if str(i)!=str(i)[::-1]:
                print(i,end=" ")

positive_int = int(input())
reverse_prime(positive_int)

#哥德巴赫猜想
def is_prime(x):
    if x < 2:
        return False
    for j in range(2, int(x ** 0.5) + 1):
        if x % j == 0:
            return False
    return True
def goldbach_conjecture(num):
    if num < 4 or num % 2 == 1:
        print("Data error!")
    else:
        for i in range(num // 2 + 1):
            if is_prime(i) and is_prime(num - i):
                print(f"{num}={i}+{num - i}")
if __name__ == '__main__':
    positive_even = int(input())  # 输入一个正数
    goldbach_conjecture(positive_even)

#本月天数
def is_leap(year):
    year=int(year)
    if((year%4==0 and year%100!=0) or year%400==0 ):
        return True
    else:
        return False

def days_of_month(date_str):
    ls=["01","03","05","07","08","10","12"]
    if date_str[4:6]=="02" :
        if is_leap(date_str[:4]):
            return 29
        else:
            return 28
    elif  date_str[4:6] in ls:
        return 31
    else :
        return 30

if __name__ == '__main__':
    date_in = input()
    print(days_of_month(date_in))

#华氏度转摄氏度速查表
def F2C(f1,f2):
    for n in range(f1,f2+1,2) :
        print(f"{n} : {(5*(n-32)/9):.2f}")
        n+=2
a,b=map(int,input().split(","))
if a>b:
    print("error")
else:
    F2C(a,b)

#奇偶求和
s=input()
oddsum=0
evensum=0
for i in s:
    if int(i)%2!=0:
        oddsum+=int(i)
    else:
        evensum+=int(i)
print(f"oddsum={oddsum},evensum={evensum}")

#字母查找
m = input()
k = 0
if (m.isalpha()):
    n = input()
    for i in m:
        if i not in n:
            print('NOT FOUND')
            k = 1
            break
    if k == 0:
        print('FOUND')
else:
    print('ERROR')




